<template>
	<view>
		<u-navbar title="简介" rightText="" placeholder="true" @rightClick="update()" @leftClick="leftClick" :autoBack="true">
		</u-navbar>
		<view class="goods" v-for="(item,index) in data" :key="index">
		<view class="goods-left">
			<u-avatar src="https://www.pmdaniu.com/storages/128883/c30852cb8b54afb8568d1f9db2822068-57026/images/%E7%AE%80%E5%8E%86%E8%AF%A6%E6%83%85/__80px_u3556.png" size="80"></u-avatar>
		</view>
		<view class="goods-right" style="width: 280px;height: 80px;">
			<view class="txt-line2"><h3>{{item.rname}}</h3></view>
			<div  class="zt" style="width: 80px;">
				<button style="background-color : #fffaed;color: #fffaed;height: 
				40px;width:60px;
				font-size:10px;
				font-style: 'margin-left:10rpx;'"
				>待核</button>
			</div>
			
			<div class="ztt"><font  size="3">待初筛</font></div>
			<view class="txt">
				<view style="width: 280px;">
					<view class="txt"><font  size="2">28岁｜</font></view>
					<view class="txt"><font  size="2">{{item.experience.education}}｜</font></view>
					<view class="txt"><font  size="2">{{item.work.workhours}}经验｜</font></view>
					<view class="txt"><font  size="2">{{item.work.severance}}k以上</font></view>
					<view class="txt"><font  size="2">电话 {{item.rphone}}</font></view>
					<view class="txt1"><font  size="2">邮箱 {{item.remail}}</font></view>
				</view>
			</view>
		</view>
		</view>
		<view class="control">
			<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"
			style-type="button" active-color="#3472d4"></uni-segmented-control>
			<view class="content">
				<view v-show="current == 0">
					<view class="goods" v-for="(item,index) in data" :key="index">
					<view class="jc">
						<h2>基础操作</h2>
						</br>
						<view ><text>姓名</text></view>  		<view class="jct2"><text>{{item.rname}}</text></view>
						<view class="jct1"><text>手机号码</text></view>   	<view class="jct2"><text>{{item.rphone}}</text></view>
						<view class="jct1"><text>员工性别</text></view>  	<view class="jct2"><text>女</text></view>
						<view class="jct1"><text>出生日期</text></view>  	<view class="jct2"><text>{{item.rbirthday}}</text></view>
						<view class="jct1"><text>学历</text></view>	 	<view class="jct2"><text>{{item.experience.education}}</text></view>
						<view class="jct1"><text>工作经验</text></view>  	<view class="jct2"><text>{{item.work.workhours}}</text></view>
						<view class="jct1"><text>籍贯</text></view>	 	<view class="jct2"><text>{{item.nativeaddres}}</text></view>
						<view class="jct1"><text>居住地址</text></view>  	<view class="jct2"><text>{{item.address}}</text></view>
						<view class="jct1"><text>婚姻状况</text></view>  	<view class="jct2"><text>{{item.marriage}}</text></view>
						<view class="jct1"><text>政治面貌</text></view>  	<view class="jct2"><text>{{item.political}}</text></view>
						<view class="jct1"><text>微信</text></view>	 	<view class="jct2"><text>{{item.rwechat}}</text></view>
						<view class="jct1"><text>QQ</text></view>	 	<view class="jct2"><text>{{item.rqq}}</text></view>
						<view class="jct1"><text>邮箱</text></view> 		<view class="jct2"><text>{{item.remail}}</text></view>
						<view class="jct1"><text>自我评价</text></view>  	<view class="jct2"><text>{{item.evaluation}}</text></view>
					</view>
					</view>
				</view>
				<view v-show="current == 1">
						<view class="cj" v-for="(item,index) in caozuo" :key="index">
						<view class="ct">
						<text >{{item.shijian}}</text>
						<view  class="ct2">
						<text>{{item.xziduan}}被{{item.caozuo}}为{{item.xin}}</text>
						</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="button">
			<button class="button1" @click="tongguo()" style="width: 40%;color: #fff;background-color: blue;">通过</button>
			<button class="button2" @click="taotai()" style="width: 40%;color: #fff;background-color: red;">淘汰</button>
			<button class="button3" @click="delete1()" size="mini">删除</button>
		</view>
		
	</view>
</template>

<script>
	import uniSegametedCintrol from"@/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue"
	export default {
		components:{
			uniSegametedCintrol
		},
		data() {
			return {
				data:{},
				caozuo:{},
			    items: ['简历', '操作记录'],
				current: 0,
				value1: 0,
				rid:"",
				status:""
			}
		},
		onLoad(options) {
			this.rid=options.rid
			this.status = options.status
			console.log(options.id)
			this.findAll();
			this.findCao();
		},
		methods: {
			onClickItem(e){
				if(this.current !== e.current){
					this.current = e.currentIndex;
				}
			},
			findAll(){
				console.log("1111111"),
				this.$request({
					url: 'entry/jianli/findById',
					data: {
						rid:this.rid
					},
					method: 'GET',
					success: (res) => {
						console.log(res.data)
						this.data = res.data
					}
				})
			},
			findCao(){
				this.$request({
					url: 'entry/jianli/findCao',
					data: {
						rid:this.rid
					},
					method: 'GET',
					success: (res) => {
						console.log(res.data)
						this.caozuo = res.data
					}
				})
			},
			click1(e) {
				console.log('click1', e);
		},
		tongguo(){
			this.$request({
				url: 'entry/jianli/tongguo',
				data: {
					status:this.status,
					rid:this.rid
				},
				method: 'GET',
				success: (res) => {
					console.log(res.data)
					this.data = res.data
				}
			})
			this.findAll();
		},
		taotai(){
			uni.navigateTo({
				url:'./taotai?rid='+this.rid
			})
		},
		update(){
			uni.navigateTo({
				url:'./bianji?rid='+this.rid
			})
		},
		delete1(){
			this.$request({
				url: 'entry/jianli/delete',
				data: {
					rid:this.rid
				},
				method: 'GET',
				success: (res) => {
					console.log(res.data)
					this.data = res.data
				}
			})
			uni.navigateTo({
				url:'./zhaopin'
			})
		},
		leftClick(){
			uni.navigateTo({
				url:'./zhaopin'
			})
		}

}
	}
</script>

<style>
	.txt{
		margin-left:10rpx;
		margin-top: 10rpx;
		float:left;
	}
	.txt1{
		margin-left:50rpx;
		margin-top: 10rpx;
		float:left;
	}
	.zt{
		margin-top: -48rpx;
		margin-left:180rpx;
		position:relative;
		z-index: index auto;
		
	}
	.txt-line2{
		margin-top: 50rpx;
		margin-left:10rpx;
	}
	.ztt{
		margin-top: -45rpx;
		margin-left:210rpx;
		position:relative;
		z-index: 50;
		color: #ffd67a;
		font-family:cursive;
		font-weight:bold;
	}
	.goods-left {
		margin-top: 60rpx;
		
	}
	
	.goods-right {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}
	.goods {
		background-color: #fff;
		padding: 30rpx;
		padding-bottom: 20rpx;
		display: flex;
		height: 140px;
	}
	.control{
		margin-top: -20rpx;
	}
	.jc{
		margin-top: 50rpx;
		margin-left: 20px;
	}
	.jct1{
		margin-top: 20rpx;
	}
	.jct2{
		margin-top: -40rpx;
		margin-left: 100px;
	}
	.ct{
		margin-top: 50rpx;
	}
	.cj{
		margin-left: 50px;
	}
	.ct2{
		margin-top:5px
	}
	.button{
		margin-top: 100%;
	}
	.button1{
		margin-left: 0px;
		margin-top:5px
	}
	.button2{
		margin-left: 160px;
		margin-top:-46px
	}
	.button3{
		margin-left: 330px;
		margin-top:-100px
	}
</style>
